package com.jxs.tourist.service.impl;

import com.jxs.tourist.dao.ToiletDao;
import com.jxs.tourist.domain.Toilet;
import com.jxs.tourist.service.ToiletService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ToiletServiceImpl implements ToiletService {
    @Autowired
    ToiletDao toiletDao;
    public ToiletServiceImpl(){
        System.out.println("init");
    }

    public int addToilet(Toilet toilet) {
        return toiletDao.addToilet(toilet);
    }

    public List<Toilet> getAllToilet() {
        return toiletDao.getAllToilet();
    }

    public List<Toilet> getToiletByTouristId(int tourist_id) {
        return toiletDao.getToiletByTouristId(tourist_id);
    }

    public int editToilet(Toilet toilet) {
        return toiletDao.editToilet(toilet);
    }

    public int delToiletById(int id) {
        return toiletDao.delToiletById(id);
    }

    public Toilet getToiletById(int id) {
        return toiletDao.getToiletById(id);
    }
}
